-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Critter combined tree #113
base: develop
Are you sure you want to change the base?
Conversation
source files for tree visualisations in issue:#110
add 4 Subtrees into megatree with sequential prioritizaition
// First Guard fo Selector for Territory End. | ||
guard: { // Implementation of scared Critter | ||
componentPresent: "Behaviors:FindNearbyPlayers", | ||
values: ["N charactersWithinRange != null"], // Adjust for Nemesis / Scary Creatures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this in the meeting today.
The N
is a parsing directive that specifiies whether the condition has the form type fieldName operator
or type fieldName operator valueOrReference
.
Technically, we could use V charactersWithinRange != null
to ensure that the list itself is defined and not null
(checking agains the value null
). However, this is not the semantics we are looking for.
Therefore, using the nonEmpty
operator on the collection with no value to check against (N
) is the solution:
values: ["N charactersWithinRange != null"], // Adjust for Nemesis / Scary Creatures | |
values: ["N charactersWithinRange nonEmpty"], // Adjust for Nemesis / Scary Creatures |
// Territory would to be implemented as Component | ||
// Implementation of territorial Critter | ||
componentPresent: "Behaviours:Territory", | ||
values: ["F Territory != null"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would try to make a lookup of a field (indicated by F
) named null
.
However, I believe you want to check against the value null
, thus using V
would be correct.
values: ["F Territory != null"], | |
values: ["V Territory != null"], |
Alternatively, you can use the exists
operator (basically ... != null
) without an explicit value to check against:
values: ["F Territory != null"], | |
values: ["N Territory exists"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the comment above about the component, this should most likely be
values: ["F Territory != null"], | |
values: ["F location exists"], |
|
||
// Territory would to be implemented as Component | ||
// Implementation of territorial Critter | ||
componentPresent: "Behaviours:Territory", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the TerritoryComponent
exists in the Behaviors module.
The closest thing we have is TerritoryDistance, a component with two fields distance
and location
.
Therefore, the referenced component should probably be
componentPresent: "Behaviours:Territory", | |
componentPresent: "Behaviours:TerritoryDistance", |
and the referenced field below cannot be Territory
(as it does not exist) but either distance
or location
. I suspect that we can check whether the location is set.
change behaviour system from hard coded to configurable
Use for configuration of different entities to flee from Implement Action in combinedCritter.behavior for new component
adressing review comments
game crash on BehaviourTree initialisation because of NullPointerException
…nt to sheepBase combinedCritter.behaviour crash on Territory stage cause of missing parameters
creature.saveComponent(territoryComponent); | ||
} | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this unnecessary when we look at the update Function above?
entity.getComponent(LocationComponent.class).getWorldPosition(new Vector3f())); | ||
entity.saveComponent(territoryDistance); | ||
for (EntityRef entity : entityManager.getEntitiesWith(TerritoryComponent.class, LocationComponent.class)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this how it its supposed to work for DistanceSquared?
NullPointerExceptions caused by missspelling
moveTo sets GoalEntity but doesnt update GoalPosition and path naiveMoveTo does probably originates from pathfinding migration
using field instead of component
I combined several critter behaviors into one.
Based on the student project in cooperation with @jdrueckert @skaldarnar
Goal is to have an universal behavior which differs based on their configuration not their implementation.